/**
 * @file calculator.h
 *
 */
#ifndef CALCULATOR_H
#define CALCULATOR_H

#ifdef __cplusplus
extern "C" {
#endif

/*********************
 *      INCLUDES
 *********************/

#ifdef LV_CONF_INCLUDE_SIMPLE
#include "lvgl.h"
#include "lv_watch_conf.h"
#else
#include "../../../lvgl/lvgl.h"
#include "../../../lv_watch_conf.h"
#endif

#if USE_LV_WATCH_CALCULATOR != 0

/*********************
 *      DEFINES
 *********************/

/**********************
 *      TYPEDEFS
 **********************/
typedef struct {
    lv_watch_obj_ext_t lv_watch_obj;
    /*New data for this type */
    lv_obj_t * cont_circle;
    lv_obj_t * cont_warn;
    lv_obj_t * label;
    lv_obj_t * page;
    uint8_t input_len;
    bool finish_flag;
    bool point;
    char * oper;
    lv_task_t * warn_task_p;
    bool pr_lost;
} lv_calculator_obj_ext_t;

/**********************
 * GLOBAL PROTOTYPES
 **********************/

/**
 * Create a calculator application
 */
void calculator_create_event_cb(lv_obj_t * btn, lv_event_t e);

/**********************
 *      MACROS
 **********************/

#endif /*USE_LV_WATCH_CALCULATOR*/

#ifdef __cplusplus
} /* extern "C" */
#endif

#endif /*CALCULATOR_H*/
